Assessing Time Series Reversibility through Permutation Patterns

Time irreversibility, i.e., the lack of invariance of the statistical properties of a system under time reversal, is a fundamental property of all systems operating out of equilibrium. Time reversal symmetry is associated with important statistical and physical properties and is related to the predictability of the system generating the time series. Over the past fifteen years, various methods to quantify time irreversibility in time series have been proposed, but these can be computationally expensive. Here, we propose a new method, based on permutation entropy, which is essentially parameter-free, temporally local, yields straightforward statistical tests, and has fast convergence properties. We apply this method to the study of financial time series, showing that stocks and indices present a rich irreversibility dynamics. We illustrate the comparative methodological advantages of our method with respect to a recently proposed method based on visibility graphs, and discuss the implications of our results for financial data analysis and interpretation.


Introduction
Time irreversibility is the lack of invariance of the statistical properties of a signal under the operation of time reversal. In other words, consider a time series describing the evolution of a system, x(t) with t ∈ [0, T] and its time reversal, i.e., the time series that would have been obtained had the system evolved in the opposite direction, or x t.r. (t) = x(T − t). Irreversibility means that it is possible to find a characteristic that differs in the forward and backward versions, i.e., a function f calculated over the two time series such that f (x t.r. ) = f (x); in other words, the observer can distinguish the forward, from the backward version of a given process. Note that the above definition does not impose any restriction on f . Irreversibility can be due to the presence of memory, which acts as a hidden dissipative external force in a process [1] while the presence of noise results in a loss of irreversibility [2]. Thus, estimating the degree of irreversibility of a time series implicitly quantifies the degree of nonlinear dependences (memory), and, therefore, the degree of time series predictability. Importantly, since linear Gaussian random processes and static nonlinear transformations of such processes are reversible, significant time irreversibility excludes Gaussian linear processes as models for the generating dynamics, implying instead nonlinear dynamics, non-Gaussian (linear or nonlinear), or linear autoregressive moving average (ARMA) models as possible generative processes [3][4][5].
The mere statistics of observed time series allows extracting information on the physics of the system under study. In particular, time reversal asymmetry provides information about the entropy production of the physical mechanism generating the series, even when the details of the underlying generating system are unknown [6]. Various methods to quantify time reversibility have been proposed [7][8][9][10][11] and applied to the study of both biological [12,13] and financial systems [2,[14][15][16][17][18][19][20][21].
Here, we introduce a new method, based on permutation entropy [22,23], to evaluate irreversibility of time series at various temporal scales. With respect to existing methods, the proposed one presents various advantages: (1) it has no free parameters other than the embedding dimension of the permutation entropy; (2) similar to visibility graph methods [9], it is temporally local, and therefore allows assessing fluctuations; (3) assessing significance is straightforward, and does not rely on scaling arguments as in visibility graph methods; and (4) it has a convergence speed advantage over visibility graph methods.
We first illustrate our method by evaluating the time irreversibility of a set of simple dynamical models, including stochastic models and chaotic dynamical systems, for which such property has theoretically been studied. We further show how the proposed approach can help elucidate the complex irreversibility dynamics of financial time series, representing 30 major European stocks and 12 world indices.
The time-reversal properties of financial time series allow testing the so-called efficient market hypothesis (EMH) [20]. The EMH asserts that financial markets are efficient with respect to an information set, i.e., that stocks incorporate all publicly available information useful in evaluating their prices and no single market agent can consistently outperform the market with information based trading [24]. Importantly, efficiency is related to the amount of information available to predict future market prices, with lower efficiency corresponding to higher residual predictive information in the past sequence of stock prices [25]. The stringency of EMH's requirements suggests that no real market can ever be efficient stricto sensu [26] and that EMH should not be approached as an all-or-nothing property [27]. Various empirical studies have then undertaken to quantify the extent to which the EMH holds and, as a result to identify the sort of process governing market behaviour [27][28][29][30]. While financial series have been found to generally be time irreversible [2,14,20,31], it is possible to discriminate different degrees of such property. For instance, some stocks have been found to be more irreversible than others [11]. Likewise, emerging markets have been shown to be more time irreversible than developed ones, lending support to the relationship between efficiency and irreversibility [32].
We show that stocks' and indices' time series present a rich dynamics in terms of irreversibility. Specifically, while some time series may globally be reversible, they can become irreversible at specific temporal resolutions, i.e., when windows of specific length are considered. Additionally, such irreversibility may appear in a temporal localised way, suggesting that the dynamics of the element was somehow perturbed at that time.
The remainder of the paper is organised as follows. Firstly, the proposed method is described in Section 2; we also include a brief overview of the visibility graph (Section 2.3) and of the Markov chain (Section 2.4) approaches, as they are used to benchmark our solution. We then validate the permutation patterns' method in synthetic (Section 3) and financial (Section 4) time series. Some conclusions are finally drawn in Section 5.

Permutation Patterns
The idea of analysing the permutation patterns present in a time series was initially introduced by Bandt and Pompe [22] to provide researchers with a simple and efficient tool to characterise the complexity of the dynamics of real systems. With respect to other approaches, as entropies, fractal dimensions, or Lyapunov exponents, it presents the advantage of being independent from any arbitrary thresholds or binning procedures [23]. For the sake of completeness, we here briefly review the process of calculating these permutation patterns.
Given a time series X = {x t }, with t = 1 . . . N, this is usually divided in overlapping regions of length D, such that: s → (x s , x s+τ , . . . , x s+τ(D−2) , x s+τ(D−1) ). (1) D is called the embedding dimension, and controls the quantity of information included in each region, while τ is the embedding delay. s further controls the beginning of each region, and thus the degree of overlap between regions. Without loss of generality, in the following, we consider D = 3 and τ = 1.
The second step involves associating an ordinal pattern to each region. Values are sorted in increasing order, and the ordinal pattern corresponding to the required permutation is saved for further analysis. In other words, the permutation π = (r 0 , r 1 , . . . , r D−1 ) of (0, 1, . . . , D − 1) is defined to fulfil: To illustrate, suppose a time series X = (3,2,6,4,8). As D = 3, the first region would include the values (3,2,6), and the order required for sorting them is (1, 0, 2)-that is, the second value is the smallest, followed by the first and by the last. Similarly, the second region (2,6,4) is associated with the pattern (0, 2, 1); and the third region (6,4,8) with (1, 0, 2).

Time Reversibility of Permutation Patterns
After estimating all the permutation patterns in a time series, we analyse their frequency of appearance, taking into account a time reversal process.
The total number of permutation patterns that may appear is given by D!. These patterns can be paired together, such that each pattern composing a pair is the time reversal of the other. For instance, for D = 3, six patterns are generated, which can pairwise be related as: (1, 0, 2) t.r. ↔ (2, 0, 1) (1, 2, 0) t.r. ↔ (0, 2, 1), with t.r. ↔ representing a time reversal transformation. To clarify this idea, let us consider the simple example of a time series resembling a sawtooth, X = (1, 2, 3, 1, 2, 3, 1). The series is stationary, as the average oscillates around 2.0, and five permutation patterns of side D = 3 can be extracted: (0, 1, 2), (1, 2, 0), (2, 0, 1), (0, 1, 2) and (1, 2, 0). It can be observed that the system has non-trivial dynamics, as it always increments in two consecutive steps at a time-hence, the upward pattern (0, 1, 2). Let us now consider the time reversed series, i.e., the same series observed from the end to the beginning: X = (1, 3, 2, 1, 3, 2, 1). The new (time reversed) permutation patterns are (0, 2, 1), (2, 1, 0), (1, 0, 2), (0, 2, 1) and (2, 1, 0). As it should be expected, the new time series can only diminish through the (2, 1, 0) permutation pattern-which is, of course, the time reversal equivalent of (0, 1, 2). Note that this allows us to conclude that the time series X is irreversible. Specifically, let us suppose that we observe a realisation of X with two consecutive increasing values, i.e., (0, 1, 2); as this can only appear in the original time series, and not in the time reversed one, we can then be certain about the time directionality. In a similar fashion, if we observe the pattern (2, 1, 0), we can conclude that we are observing the time reversed series.
This can further be generalised: a time series will be reversible if and only if all permutation patterns composing the previous pairs appear with approximatively the same frequency. In the previous example, we can observe that the probability of (0, 1, 2) and (2, 1, 0) in the original time series are different-respectively, p (0,1,2) = 2/5 and p (2,1,0) = 0/5. Once again, X is then expected to be irreversible. This idea constitutes the basis of the reversibility statistical test described below.
The value of D = 3 has here been chosen for the sake of clarity. While in principle larger values of D may yield a richer description of the dynamics, this also results in the need of longer time series to reach statistically significant results-both topics will be further discussed in the conclusions.
The previously defined pattern pairs and their frequency of appearance can be analysed in two ways: in terms of the magnitude of the irreversibility, through the Kullback-Leibler divergence [33], and in terms of its statistical significance, through a binomial test.
The irreversibility magnitude can be quantified by comparing two probability distributions, one represented by the probability of all patterns appearing in the direct (or original) time series, and a second one with the probabilities for the time-reversed time series. Following the previous example for D = 3, the first distribution is composed of the frequencies of patterns P d = ]. As for the second distribution, it can be calculated by actually reversing the time series, or more simply by using the previous time reversal transformations-i.e., by considering the distribution P r = [p (2,1,0) , p (0,1,2) , p (2,0,1) , p (1,0,2) , p (0,2,1) , p (1,2,0) ]. The difference between both distributions can then be estimated through the Kullback-Leibler divergence: If the time series is perfectly reversible, the probabilities associated to patterns forming a pair should be the same, thus yielding a D KL ≈ 0. On the other hand, the higher the value of D KL , the more irreversible the time series is. Note that D KL is not the only possibility for comparing the two distributions, being the Jensen-Shannon divergence a good alternative [34]. While the latter presents the advantage of being symmetric, the former is commonly used in statistical physics [9,35]. Additionally, it has to be noted that Equation (6) diverges when one or more permutation patterns are forbidden, i.e., their frequency is zero. This may happen when the time series under analysis is trivially irreversible, and possibly non-stationary. This is for instance the case of the ramp function previously described; when i = 0 in Equation (6), the argument of the logarithm becomes p (0,1,2) /p (2,1,0) = 2/0, and thus D KL → ∞. While this clearly indicates that the time series is (infinitely) irreversible, the divergence of D KL may make subsequent calculations more complicated. This can easily be solved by adding a very small value to all probabilities, i.e., such that min P d and min P r . This situation is nevertheless seldom encountered in real time series, provided their length is large enough.
If the Kullback-Leibler divergence tells us the magnitude of the irreversibility of a time series, it yields little information about the statistical significance of the value. This problem can be solved by levering on the binomial nature of the patterns composing a pair. Specifically, if the time series is reversible, the number of times the two permutation patterns forming a pair appear should not statistically be different. Following the previous example, let us denote by n (0,1,2) and n (2,1,0) , respectively, the number of times the patterns (0, 1, 2) and (2, 1, 0) have appeared; and let us define: The time series is not reversible if we can reject the null hypothesis that p = 0.5 in a two-sided binomial test. Note that the test should be repeated for all pairs of permutation patterns-three times in the case of D = 3.
One final discussion should here be added on the relationship between irreversibility and stationarity, and how such relationship affects the proposed methodology. On the one hand, it is intuitive that a non-stationary process must also be irreversible-as a net change from state a to state b necessarily implies a time direction. Time irreversibility has therefore normally been assessed only in the presence of stationarity. On the other hand, it has recently been proposed that reversibility can be assessed even in non-stationary systems, by moving from a qualitative to a quantitative metric [35]. In the case of the methodology here proposed, the degree of irreversibility of a time series can be assessed by the magnitude of D KL (or of a Jensen-Shannon divergence), provided no permutation pattern is forbidden, i.e., P r (i) > 0 for all i. This quantitative aspect will be further explored in Section 4.

Directed Horizontal Visibility Graphs
One of the most recent and efficient ways of assessing the irreversibility of a time series is through the so-called directed Horizontal Visibility Graphs (dHVG). In what follows, this method is used for benchmark purposes, and, for the sake of completeness, is here briefly introduced.
From a general point of view, dHVG belong to a family of methods that map a time series into nodes of a network, based on geometric criteria [36,37]. In all of these methods, a complex network [38] is created, whose nodes correspond to the individual data of the time series; pairs of nodes are then connected when they fulfil some geometrical rule, usually based on whether one value can "see" the other one. In the specific case of dHVG, two nodes are connected if the line connecting both values is not obstructed by another intermediate point [37]. Mathematically, given two nodes i and j, a link is created if: being x i the element of the time series mapped into node i. The resulting network can then be analysed using the wide set of tools provided by complex networks theory [39]. Of relevance for this work, the irreversibility of a time series can be assessed by comparing the distributions of in-and out-degrees (i.e., respectively the number of links arriving to and departing from a given node), and by calculating a Kullback-Leibler divergence [9,11]. Note that the in-degree of a node becomes its out-degree under a time reversal transformation. Therefore, for reversibility to holds both distributions ought to be equal, and the corresponding Kullback-Leibler divergence should converge to zero. For more details on the dHVG approach and the assessment of irreversibility, we refer the reader to the following studies [9,11,37].

Markov Chain Approach
We finally consider a classical method for detecting time series irreversibility, based on the representation of the underlying system as a Markov chain. In the case of a Markov chain with a transition matrix P i,j and steady-state distributions π i , time symmetry implies π i P i,j = π j P j,i ; a time series is then reversible if and only if P i,j = P j,i , for all is and j = i [40]. We use this property to construct a simple test, which requires: (i) binning the elements of the original time series into a set of bins (note that the number of bins is a parameter of the method); (ii) calculate the transition matrix P i,j ; and (iii) perform a binomial statistical test on each pair (i, j), with j = i, to test the hypothesis that P i,j = P j,i .

Validation with Synthetic Time Series
We validate the permutation patterns approach to irreversibility assessment, and compare it with the visibility graph one, through the application to a set of synthetic time series whose reversible or irreversible nature has already been studied theoretically. These are: • Two reversible stochastic processes, namely a time series of values drawn from a Gaussian distribution N (0, 1), and an Ornstein-Uhlenbeck process, a mean-reverting linear Gaussian process T [41]. • Two dissipative chaotic maps, respectively, a logistic map (defined as x n+1 = ax n (1 − x n ), with a = 4.0) and a Henon map (x n+1 = 1 + y n − ax 2 t , y n+1 = bx t , with a = 1.4 and b = 0.3). Dissipative systems are by definition irreversible [42]. • The Arnold Cat map, and example of a conservative chaotic map (x n+1 = x n + y n mod (1), y n+1 = x n + 2y n mod (1). The analysed time series corresponds to the evolution of the x variable. • The Lorenz chaotic system, defined asẋ = σ(y − x),ẏ = x(ρ − z) − y, andż = xy − βz (with ρ = 28, σ = 10 and β = 8/3, integration step of dt = 0.01). Unless otherwise stated, the analysed time series corresponds to the evolution of the x variable. • Time series generated through an Autoregressive Conditional Heteroskedasticity (ARCH) model [43] defined as and z t being independent random numbers drawn from an uniform distribution U (0, 1). Note that α * is a parameter controlling the strength of the time dependence between present and past values of x, and hence its irreversibility.

•
Time series generated through a Generalised Autoregressive Conditional Heteroskedasticity (GARCH) model [44] defined as and z t being independent random numbers drawn from an uniform distribution U (0, 1). Note that the difference with respect to the ARCH model resides in the fact that here σ depends directly on its past. As in the previous case, α * is controlling the time irreversibility of the model.
For each of them, Figure 1 reports: (i) the average divergence D yielded by the permutation patterns (blue line and one standard deviation band) and the visibility graph (black line and band) approaches; and (ii) the fraction of times the time series is detected as irreversible by the permutation patterns approach in a statistical significant way (red dotted line, right Y axis, significance α = 0.01). The irreversibility of the time series created by the ARCH and GARCH models is reported in Figure 2, as a function of the parameter α * . The two examples of stochastic processes and the Arnold map are recognised as irreversible in less than 1% of the realisations-as expected from the choice of a statistical significance level of α = 0.01. On the other hand, the irreversibility frequency rapidly converges to one for the two dissipative chaotic maps, which are known to be irreversible [42]. Intermediate results can be observed in the case of the ARCH and GARCH models, for which a robust irreversibility is detected in the case of long time series and high values of α * . Finally, a special situation can be observed for the Lorenz system: while its time series are mostly irreversible at short temporal scales, they become highly reversible when sufficiently long time windows are considered. To understand if such behaviour is a general property of the system, Figure 3 (Left) reports the evolution of the irreversibility as a function of time series length, for the three channels of the Lorenz system. While the X and Y channels have a similar dynamics, the Z one is substantially different: first it is completely irreversible over long time scales, and second, the evolution of the irreversibility is not monotonic, with a minimum around 70 and a peak every 60 time points. This abnormal behaviour for the Z time series is possibly due to its dynamics, which is well known to differ from those of the X and Y channels in terms of Lyapunov exponent [45] and autocorrelation (see Figure 3, Right).   Figure 1 further suggests that the permutation patterns approach to irreversibility can be more sensitive than the visibility graph one-note that the < D > blue lines usually have a steeper slope, and converge faster than the black ones. Figure 4 depicts the fraction of times the three considered methods detect that the underlying time series is irreversible in a statistical significant way (α = 0.01), for very short time series lengths and for the two systems that were detected as irreversible (i.e., respectively, the Logistic and Henon maps). Note that, to calculate the statistical significance of the divergence yielded by the visibility graph approach, this has been compared with the ones obtained from randomly shuffled versions of the time series, and the probability of finding a larger D in the random realisations expressed as a p-value. Figure 4 indicates that the permutation pattern approach requires shorter time series to reach a consistent output, something that is particularly conspicuous in the case of the Henon map. Additionally, these results highlight the benefit associated to parameter-free methods. Specifically, the Markov chain method has been tested with two different numbers of bins, respectively 4 (green dotted lines) and 8 (grey dotted lines), yielding different results depending on the underlying dynamics. The fact that the proposed methodology required no parameter estimation or tuning thus becomes an important practical advantage.  Finally, Figure 5 explores the resilience of the proposed method with respect to the presence of noise. Specifically, we consider the previously described logistic map, and added a Gaussian noise: with a = 4.0 and ξ being independent random numbers drawn from a Gaussian distribution N (0, 1). Note that noise is inherently reversible, and therefore its presence is expected to mask the irreversibility of the logistic map. We then measure the minimum time series length that allows to detect the irreversibility of the system the 90% of the times, and plot this as a function of the noise level σ. The two solid lines in Figure 5 report the results, and indicate that the permutation patterns approach is more resilient than the visibility graph one. Taken together, the numerical experiments carried out on synthetic time series indicate that the permutation patterns approach is comparable to the visibility graph one in assessing irreversibility. The former is nevertheless more sensitive, as it relies more on local patterns (of dimension D), and more resilient to noise, thus more suitable for the analysis of short time series. We take advantage of this in Section 4 by analysing the temporal evolution of the irreversibility of real time series. Finally, the local nature of the permutation patterns approach makes it extremely computationally efficient-with a computational cost that scales linearly with the number of data points, as opposed to the quadratic growth of the visibility graph approach.

Application to Financial Time Series
To further validate the proposed methodology, we assess the irreversibility of several financial time series. These can be thought of as relatively short realisations of complex stochastic processes whose dynamics is richer than most of the generated time series, and their characteristics (including reversibility) can change over time. Dynamical repertoire richness and time series shortness are two desirable aspects from a validation view-point. As previously introduced, if financial time series were shown to be irreversible, i.e., if some permutation patterns were favoured over their corresponding time-reversed counterparts, this would disprove the efficient market hypothesis (EMH) [20], as the asymmetry would be associated with information with which to improve the prediction of future prices.
We consider two sets of time series representing the daily evolution of, on the one hand, the Top-30 European stocks by capitalisation; and, on the other hand, of 12 representative world stock market indices. Tables 1 and 2 report the two full lists, along with some basic characteristics. Both sets of time series have been obtained through Yahoo Finance, and include data from 1 January 2008 to 1 January 2018-note that the actual number of data points may differ, e.g., due to local bank holidays. To ensure the stationarity of all time series, the original values X t have been transformed tô X t = log 2 X t+1 /X t . The resulting seriesX have been tested through an Augmented Dickey-Fuller unit root test [46], and for all of them the presence of a unit root was rejected in a statistically significant way (the larger p-value being 2.48 × 10 −14 for the BNP.PA stock).
Each time series was analysed in three different ways. The first one entails estimating global irreversibility, i.e., taking into account the whole time series. This corresponds to the irreversibility of the system, under the assumption that such property is stationary, or to the assessment of the average irreversibility. Three stocks and four indices resulted irreversible: BBVA.MC, ENEL.MI, and G.MI; and DJI, GDAXI, GSPC and IXIC, respectively. This indicates that markets have preferred ways (or patterns) when rallying up-or downwards, and are therefore strictly not efficient. It is also interesting to observe that irreversibility is more frequent in indices (four out of twelve) than in individual stocks; this may suggest that irreversibility is a collective (or emergent) phenomenon, which is difficult to see in the dynamics of individual elements, but shows up when considering groups of them. Even when the complete time series is reversible, it is possible to find shorter sub-windows which are not reversible in a statistically significant way. Thus, it may happen that time series are globally reversible, but locally irreversible. We explore this possibility in a second analysis, in which we extract all possible sub-windows of a given length from each time series, and calculate their average irreversibility. Note that this allows estimating irreversibility as a function of the time window length, and thus the relationship between irreversibility and time scales. In other words, this second approach enables to study the local vs. global nature of irreversibility. Results of this analysis, in terms of the fraction of windows yielding a statistically significant irreversibility (α = 0.01) as a function of the window length, are presented in Figures 6 and 7. Three general ideas can be drawn from these results. First, many time series that are globally reversible display noisy results, with very low irreversibility probabilities, and usually around or below the significance threshold. Secondly, those time series that are globally irreversible gain such properties at relatively long time scales-the evolution of the fraction of irreversible windows constantly increases with the window size. Specifically, when the average irreversibility of each time series is calculated for window lengths comprised between (0, 500) and (500, 1000), the resulting correlation coefficient is of 0.92612 for the 30 stocks and of 0.879552 for the 12 indices. This seems to indicate that the time series are highly noisy, and therefore that long time windows are required to reach a stable result-as previously shown in Figure 5. Finally, some time series, which are globally reversible, can contain irreversible windows with a significant probability; it thus seem that, for those time series, irreversibility is a property confined to some specific time scales. This is the case, for instance, of BAYN.DE (maximum of 20.12% for lengths of 225) or CA.PA (13.89% at 575). Given that irreversibility is, in many cases, a localised effect, we finally checked whether different stocks present a synchronised dynamics, i.e., if different stocks tend to become irreversible at the same time. Figure 8 presents a time map of the irreversibility of the 30 analysed stocks, when considering windows of 200 data points. While irreversibility seems to be slightly more probable at the end of the considered period, deviations from the expected value are not enough to support the hypothesis of synchronous dynamics.

Discussion and Conclusions
We proposed a new method to quantify irreversibility in time series based on permutation entropy. We tested our method on synthetic time series from various processes with known irreversibility properties and on financial time series of stock prices and indices. For synthetic time series, the results from our method are consistent with known irreversibility properties of the respective time series. Remarkably, particularly for the Lorenz system, the method could detect non-trivial irreversibility dynamics. Our results also show that, while most financial time series are globally reversible, the proposed method highlighted an interesting dynamics, with time windows in which the dynamics was significantly irreversible. While the results from the permutation entropy-base method were in line with those obtained with the dHVG-based method (see Figure 9), the former method compared favourably in terms of convergence speed, indicating that it can be more suitable for relatively short time series. Additionally, the proposed method is able to better handle singular situations, provided the modified version of Equation (7) is used. For instance, it is able to detect the extreme irreversibility of a ramp function; on the contrary, for such time series, the dHVG-based method yields regular networks with a constant degree of 1, as in both directions each value can only "see" the following one, thus returning a D of zero and wrongly suggesting a perfect reversibility. Our results with synthetic time series are consistent with theoretical results, indicating that the proposed method correctly identifies the underlying process. On the other hand, some results for financial time series are somehow surprising. In particular, our method returned higher irreversibility for some markets previously known to be among the most efficient ones (see Figure 7). These results were in good agreement with those obtained using dHVGs. Insofar as the presence of irreversibility may be associated with violation of the EMH, our results suggest that permutation entropy-based irreversibility and dHVGs may capture a dynamical feature that differs from standard measures of market efficiency. Further investigations will be needed to clarify the reasons for this discrepancy. Additionally, it is important to exercise caution against too literal an interpretation of financial systems' random walk in the same thermodynamic terms (viz., friction and dissipation) as the original Langevin equation [20]. Finally, it is worth pointing out that various studies [2,20,32] have suggested that a complete picture of irreversibility in financial time series should be based on a multiscale analysis, as the relationship among scales may contain important features ultimately determining time irreversibility [20]. On the other hand, analyses at given scales, as in the present study, should be interpreted in terms of irreversibility at that particular scale.
One final note should be made on the choice of the embedding dimension D, which we set to D = 3 in this study. Using higher values of D increases the richness with which the dynamics of the system is captured-see for an example [47]. In addition, it has been shown that the permutation entropy (a closely related concept) is an approximation that converges to the true entropy rate of the system in the limit of increasing embedding dimension. It is thus logical to expect a similar behaviour for the proposed measure of reversibility, which may converge to a real value for large values of D. It is nevertheless important to take into account that increasing D also comes with several disadvantages. First, obtaining reliable statistics on the appearance of the permutation patterns and reducing the influence of random fluctuations requires longer time series-as a rule of thumb, it is usually recommended to have time series of length of at least (D + 1)! [48]. This limits the resolution of the irreversibility analysis, and precludes detecting interesting phenomena at short time scales (as shown in Figure 3). Second, although, from a theoretical point of view, nothing precludes the use of higher embedding dimensions in the methodology proposed in this study, the computational cost scales exponentially with the embedding dimension-a limitation that may become serious when analysing large datasets as in some real-time applications.
Author Contributions: All authors developed the idea. M.Z. executed the numerical experiments and prepared the figures. All authors wrote and reviewed the manuscript.